package com.renwei.yunlong.activity.work;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.RelativeLayout;

import com.renwei.yunlong.R;
import com.renwei.yunlong.activity.me.MeSearchActivity;
import com.renwei.yunlong.base.BaseActivity;
import com.renwei.yunlong.utils.CommonUtils;
import com.renwei.yunlong.view.SimpleOptionView;
import com.zyf.fwms.commonlibrary.utils.StatusBarUtil;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 工单相关查询--页面
 * <p>
 * Created by Administrator on 2017/8/25.
 */

public class SearchActivity extends BaseActivity implements View.OnClickListener {


    @Bind(R.id.simpleTileView)
    SimpleOptionView simpleTileView;
    @Bind(R.id.rl_object)
    RelativeLayout rlObject;
    @Bind(R.id.rl_spare)
    RelativeLayout rlSpare;
    @Bind(R.id.rl_problem)
    RelativeLayout rlProblem;
    @Bind(R.id.rl_know)
    RelativeLayout rlKnow;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search);
        ButterKnife.bind(this);

        StatusBarUtil.setColor(this, CommonUtils.getColor(this, R.color.title_color), 0);
        initData();

    }

    private void initData() {
        simpleTileView.setTitle("工单相关查询");

        rlKnow.setOnClickListener(this);
        rlObject.setOnClickListener(this);
        rlProblem.setOnClickListener(this);
        rlSpare.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.rl_object://对象查询
                MeSearchActivity.OpenActivity(this, MeSearchActivity.FROM_TYPE_OBJECT);
                break;
            case R.id.rl_spare://备件库查询
                MeSearchActivity.OpenActivity(this, MeSearchActivity.FROM_TYPE_SPARE);
                break;
            case R.id.rl_problem://问题查询
                MeSearchActivity.OpenActivity(this, MeSearchActivity.FROM_TYPE_PROBLEM);
                break;
            case R.id.rl_know://知识库
                MeSearchActivity.OpenActivity(this,MeSearchActivity.FROM_TYPE_KNOW);
                break;
            default:
                break;
        }
    }
}
